package edu.byui.chat;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.CascadeType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;


@SuppressWarnings("serial")
@Entity
@Table(name = "user")
public class User implements Serializable{
   
    @Id
    private int user_id;
    private String user;

    @OneToMany(cascade=CascadeType.ALL)
    @JoinTable(
    name="message",
    joinColumns = { @JoinColumn( name="user_id") },
    inverseJoinColumns = @JoinColumn( name="message_id"))
    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public int getUser_id() {
        return user_id;
    }

    public void setUser_id(int user_id) {
        this.user_id = user_id;
    }
   
}


